<p class="p-modal">Tambah Tholabah pada kelas <?php foreach ($list_mk as $row) {$id_m_th_ajaranSkrg = $row->id_m_th_ajaran; $id_m_tingkat = $row->id_m_tingkat; echo $row->kelas.' - '.$th = $row->th_ajaran;$id_a_kelas = $row->id_a_kelas;}?></p>
	<div class="isi-modal">
	
		<div class="row">		
		<div class="col-md-12">

			<div class="radioFormTop">
			<label class="radio-inline" id="radioCustom">
				<input type="radio" name="pilih" value="baru" checked=""> <labelnya>Masukkan Tholabah Baru</labelnya>
			</label>
			<label class="radio-inline" id="radioCustom">
				<input type="radio" name="pilih" value="th_lalu"> <labelnya>Tholabah Tahun Lalu (<?php echo ta_kemarin();?>)</labelnya>
			</label>
			<label class="radio-inline" id="radioCustom">
				<input type="radio" name="pilih" value="pindah"> <labelnya>Pindahkan Tholabah (<?php echo $th;?>)</labelnya>
			</label>
			</div>

			<div id="baru" class="baru">
			<?php 
				echo form_open('b_kelas/save', array('id' => 'SaveTholabahBaru')); 
			?>
				<input type="hidden" name="id_a_kelas" id="id_a_kelas" value="<?php echo $id_a_kelas;?>">

				<table class="table table-borderLuar table-hover table-condensed diklik">
				<?php 
					if(count($list)>0){
						$i = 1; 
						foreach ($list as $row) {
				?>
					<tr class="kursor">
						<td class="col-sm-1">
							<input type="checkbox" name="id_m_tholabah[]" value="<?php echo $row->id_m_tholabah; ?>"> <?php echo $row->id_m_tholabah; ?>
						</td>
						<td class="col-sm-5">
							<?php echo $row->nama_lengkap; ?>			
						</td>
						<td class="col-sm-6">
							<?php echo substr($row->alamat,0,10);?>...
							<span class="pull-right"><?php if($row->jk=='Laki-laki'){echo "L";}else{echo "P";}; ?></span>
						</td>
					</tr>
				<?php
						}
					}else{
				?>
				<td>Belum ada tholabah baru lagi</td>
				<?php
					}
				?>
				</table>
				<br/>

				<span id="loadingAdd" style="display:none;">Sedang memproses..</span>
				<span id="errorAdd" style="display:none;color:red;">Ma'af, gagal menyimpan data</span>

				<span class="pull-right">
					<button type="submit" id="saveButton" class="btn btn-xs tmb-utama <?php if(count($list)<1){echo "sembunyi";}?>"> Simpan</button> 
					<button class="btn tmb-kedua close-reveal-modal close-modal"> Batal</button>
				</span>

			<?php
				echo form_close();
			?>
			</div>

			<div id="th_lalu" class="th_lalu" style="display:none;">	
				<div class="row">
					<div class="col-md-12">
					<select id="id_m_kelas" class="form-control form-elba input-sm" <?php if(count($list_k)<1){echo "disabled";}?>>
						<?php 
						if(count($list_k)>0){
						?>
							<option value="null">Pilih Kelas</option>
						<?php
							foreach ($list_k as $row_k){ 
						?>
							<option value="<?php echo $row_k->id_m_kelas; ?>"><?php echo $row_k->kelas;?></option>
						<?php		
							};
						}else{
						?>
							<option value="null">Tidak ada data kelas</option>
						<?php
						}
						?>
					</select>
					</div>
					<input type="hidden" id="id_m_th_ajaran" value="<?php foreach ($list_th as $row_th){echo $row_th->id_m_th_ajaran;}?>" />
					<input type="hidden" id="id_m_th_ajaranSkrg" value="<?php echo $id_m_th_ajaranSkrg;?>" />
					
					<br/>
					<br/>
					<br/>
					<div class="col-md-12">
						<span id="tholabah_lama"></span>
					<br/>

					</div>					
				</div>			
			</div>

			<div id="pindah" class="pindah" style="display:none;">
				<div class="row">
					<div class="col-md-12">
					<select id="id_m_kelasSkrg" class="form-control form-elba input-sm" <?php if(count($list_k_skrg)<1){echo "disabled";}?>>
						<?php 
						if(count($list_k_skrg)>0){
						?>
							<option value="null">Pilih Kelas</option>
						<?php
							foreach ($list_k_skrg as $row_kskrg){ 
						?>
							<option value="<?php echo $row_kskrg->id_m_kelas; ?>"><?php echo $row_kskrg->kelas;?></option>
						<?php		
							};
						}else{
						?>
							<option value="null">Tidak ada data kelas</option>
						<?php
						}
						?>
					</select>
					</div>
					<input type="hidden" id="id_m_tingkat" value="<?php echo $id_m_tingkat;?>" />

					<br/>
					<br/>
					<br/>
					<div class="col-md-12">
						<span id="tholabah_pindah"></span>
					<br/>

					</div>					
				</div>	
			</div>
		</div>
		</div>
	</div>